package com.yair_srm.model.service.impl;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;

import com.yair_srm.exception.POHeader_Exception;
import com.yair_srm.integration.IPOItemSAO;
import com.yair_srm.integration.IPOSAO;
import com.yair_srm.integration.IPOListDAO;
import com.yair_srm.integration.sap.impl.POList_SAP;
import com.yair_srm.model.bean.PurchaseOrder;
import com.yair_srm.model.bean.PurchaseOrderItem;
import com.yair_srm.model.service.IPOService;

public class POService implements IPOService{
	
    private IPOSAO poSAO;
    private IPOItemSAO poItemSAO;
    
	public PurchaseOrder getPoHeader(String vendor, String ponumber) throws POHeader_Exception{
		// TODO Auto-generated method stub
		PurchaseOrder order = null;
		try{
		  order = this.poSAO.getPoHeader(vendor, ponumber);
		}catch(Exception ex){
			
		}
		
		if(order==null)
			throw new POHeader_Exception(vendor,ponumber);
		
		return order;
	}
	

	public void setPoSAO(IPOSAO poSAO) {
		this.poSAO = poSAO;
	}

	public void setPoItemSAO(IPOItemSAO poItemSAO) {
		this.poItemSAO = poItemSAO;
	}

	public PurchaseOrder getPoItem(String vendor, String ponumber, String itemNo) {
		// TODO Auto-generated method stub
		return null;
	}

	public PurchaseOrderItem getPoItemDetail(String vendor, String ponumber,
			String itemno) {
		return this.poItemSAO.getPOItemDetail(vendor, ponumber, itemno);
	}
    
	
}
